package com.scs.application.modules.dept.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.scs.application.core.entity.FlowEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
/**
 * <p>
 *
 * </p>
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "科室请领表")
@TableName("dept_apply")
@EntityIndexAnnotation(ix = {"bus_key","warehouse_id"})
public class Apply extends FlowEntity {


    @EntityFieldAnnotation(
            type = EntityFieldType.LONG,
            text = "申请科室ID",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptId;

    @EntityFieldAnnotation(
            text = "申请科室名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptName;

    @EntityFieldAnnotation(
            text = "业务单号",
            length = "20",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busKey;

    @EntityFieldAnnotation(
            text = "业务日期",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    private Date busDate;

    @EntityFieldAnnotation(
            text = "业务主办人",
            length = "20",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busUser;

    @EntityFieldAnnotation(
            text = "申请仓库ID",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String applyWarehouseId;

    @EntityFieldAnnotation(
            text = "申请仓库名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String applyWarehouseName;

    @EntityFieldAnnotation(
            text = "目标仓库ID",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String warehouseId;

    @EntityFieldAnnotation(
            text = "目标仓库名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String warehouseName;



    @EntityFieldAnnotation(
            text = "备注",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remark;

    @EntityFieldAnnotation(
            text = "金额",
            length = "200",
            default_value = "0.00",
            comment = ""
    )
    private Double amount;

    @EntityFieldAnnotation(
            text = "是否作废",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Boolean isClose;

    @EntityFieldAnnotation(
            text = "申请分类",
            length = "10",
            not_null = false,
            default_value = "matr",
            comment = "matr:耗材，reagent：试剂，drugs：药品"
    )
    private String applyType;
    @EntityFieldAnnotation(
            text = "试剂组id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = ""
    )
    private String reagentTeamId;

    // 试剂组
    @TableField(exist = false)
    private String reagentTeamName;

    // 明细数量
    @TableField(exist = false)
    private int countDtl;
}
